/*
 ============================================================================
 Name        : ChatApp.c
 Author      : Francesco Corvino
 Version     :
 Copyright   : Copyright 2012 by Corvino Francesco. All rights reserved. This material may not be duplicated for any profit-driven enterprise.
 Description : Hello World in C, Ansi-style
 ============================================================================
 */

#include <stdio.h>
#include <stdlib.h>

#include "chandl/cfactory.h"

#define MAXLINE 1000

int main(void) {
    char    buf[MAXLINE];

    printf("ChatApp init - Utilizza il prompt lanciando i comandi con la seguente sintassi:\n"
    		"%%command:params\n");
    CFactory_SetConfigurationBase();
    printf("%%");
    while (fgets(buf, MAXLINE, stdin) != NULL) {
        //filtra la stringa
        DescRequest* req = CFactory_GetFilteredReq(buf);
        // esegue il comando
        invokeCMD(req);
        // stampa il prompt
        printf("\n%%");
    }
    return EXIT_SUCCESS;
}
